import 'package:p_location/common/obj/common_state_obj.dart';

class CommonStateRes {
  List<CommonStateObj> data;
  int code;
  String msg;

  CommonStateRes({this.data, this.code, this.msg});

  factory CommonStateRes.fromJson(Map<String, dynamic> json) {
    return CommonStateRes(
      data: json['data'] != null
          ? (json['data'] as List)
              .map((i) => CommonStateObj.fromJson(i))
              .toList()
          : null,
      code: json['code'],
      msg: json['msg'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['msg'] = this.msg;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
